import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * This class is just an animation that is used to get the Player a power up.
 * 
 * @author Manuel Nava
 * @version 1.0
 */
public class Cherry extends PowerUp
{
    /**
     * In the method act it called the method of the superclass move and it veryfing if the object is touching  
     * a Player.class object to remove himself.
     */
    public void act() 
    {
        super.move();
        if(isTouching(Player.class))
        {
           ((CaveWorld)(getWorld())).powerUp(1);
             getWorld().removeObject(this);
        }
    }
    
}
